import axios from "@/utils/http"
enum Api {
    login = "/v1/user/login",
    userInfo = '/v1/user/info',
    register = '/v1/user/register'
}
export const login = <T>(parmas: { account: string, password: string }) => {
    return axios.post<T>(Api.login, parmas) as Promise<T>
}

export const getUsetInfo = <T>() => {
    return axios.get<T>(Api.userInfo) as Promise<T>
}
export const updateUserInfo = <T>(data:any) => {
    return axios.post<T>(Api.userInfo,data) as Promise<T>
}

export const register = <T>(data:any) => {
    return axios.post<T>(Api.register,data) as Promise<T>
}